import request from '@/utils/request'

// 查询自测题库列表
export function listTest_bank(query) {
    return request({
        url: '/ex/test_bank/list',
        method: 'get',
        params: query
    })
}

// 查询自测题库详细
export function getTest_bank(id) {
    return request({
        url: '/ex/test_bank/' + id,
        method: 'get'
    })
}

// 新增自测题库
export function addTest_bank(data) {
    return request({
        url: '/ex/test_bank',
        method: 'post',
        data: data
    })
}

// 修改自测题库
export function updateTest_bank(data) {
    return request({
        url: '/ex/test_bank',
        method: 'put',
        data: data
    })
}

export function saveAnswers(test_id,answers){
  return request({
    url: '/ex/test_bank/saveAnswers/'+test_id,
    method: 'post',
    data: answers
  })
}

// 删除自测题库
export function delTest_bank(id) {
    return request({
        url: '/ex/test_bank/' + id,
        method: 'delete'
    })
}
